<!-- 数字地图-定位卡管理-重点人员布控 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>
          <el-col :span="8">
            <el-form-item label="日期">
              <el-date-picker v-model="fbillcredate" type="daterange" value-format="yyyy-MM-dd" range-separator="至"
                start-placeholder="开始日期" end-placeholder="结束日期">
              </el-date-picker>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="基地名称">
              <el-select v-model="fgrandname" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <template v-if="showAll">

            <el-col :span="6">
            <el-form-item label="姓名">
              <el-input v-model="listQuery.fuser" placeholder="请输入学籍号或姓名" clearable />
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="状态">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options2"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </template>

          <el-col :span="8">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" @click="getlist">查询</el-button>
              <el-button type="success" icon="el-icon-plus" @click="insert(undefined)">新增</el-button>
              <el-button type="warning" icon="el-icon-upload2">导入</el-button>
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>
                收起</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <!-- <el-table-column prop="FBILLNO" label="单号"></el-table-column> -->
          <el-table-column prop="FBILLCREDATE" label="布防日期" width="105"></el-table-column>
          <el-table-column prop="FPOINT" label="基地名称"></el-table-column>
          <el-table-column prop="FTELNO" label="楼层名称"></el-table-column>
          <el-table-column prop="FUSER" label="场地名称" ></el-table-column>
          <el-table-column prop="FMEMO" label="布防说明" ></el-table-column>
          <el-table-column prop="FBILLSTATE" label="状态" width="95"></el-table-column>
          <el-table-column fixed="left" label="操作" width="150">
            <template slot-scope="scope">
              <el-button @click.native.prevent="insert(scope.row.FCATNO)" icon="el-icon-edit" type="text" size="small">
                编辑
              </el-button>
              <el-popconfirm title="确定删除当前数据吗？" @confirm="Catdelete(scope.row.FCATNO)">
                <el-button slot="reference" icon="el-icon-delete" style="color: red;margin-left: 10px;"
                  type="text">删除</el-button>
              </el-popconfirm>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" />
        <Form ref="Form" :parelist="list" />
      </div>
    </div>
  </div>
</template>

<script>
  import jnpf from "@/utils/jnpf"
  import Form from "./Form.vue"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        showAll:false,
        fgrandname:"上海博物馆",
        fbillcredate: [jnpf.dateFormat(new Date(), "YYYY-MM-DD"), jnpf.dateFormat(new Date(), "YYYY-MM-DD")],

        //所属教学楼选择数据
        options1: [{
          value: '20E01',
          label: '上海国际汽车城'
        }, {
          value: '20E02',
          label: '上海博物馆'
        }, {
          value: '20N01',
          label: '中共一大会址纪念馆'
        }, {
          value: '20N02',
          label: '长岛庄园户外拓展基地'
        }],

        fvisiblelist: [
          { id: "1", fullName: "是" },
          { id: "2", fullName: "否" },
        ],
        total: 0,
        list: [
            {
            "FBILLNO": "K241130001", 
            "FBILLCREDATE":"2024-11-29",
            "FUSER": "1-101展位",
            "FTELNO": "一楼",
            "FUSEDATE": "2024-12-01",
            "FBEGTIME":"2024-09-14",
            "FENDTIME":"2024-09-14",
            "FMEMO": "休息时间不能离开",
            "FCHECKUSE": "",
            "FCHECKDATE": "",
            "FNOTE":"",
            "FBILLTYPE":"访客卡",
            "FBILLSTATE": "已布防",
            "FPOINT":"上海博物馆"
            },{
            "FBILLNO": "K241130002", 
            "FBILLCREDATE":"2024-11-29",
            "FUSER": "2-203展位",
            "FTELNO": "二楼",
            "FUSEDATE": "2024-12-01",
            "FBEGTIME":"2024-09-14",
            "FENDTIME":"2024-09-14",
            "FMEMO": "休息时间不能离开",
            "FCHECKUSE": "",
            "FCHECKDATE": "",
            "FNOTE":"",
            "FBILLTYPE":"访客卡",
            "FBILLSTATE": "已布防",
            "FPOINT":"上海博物馆"
            },
            ,{
            "FBILLNO": "K241130003", 
            "FBILLCREDATE":"2024-11-29",
            "FUSER": "3-301展位",
            "FTELNO": "三楼",
            "FUSEDATE": "2024-12-01",
           "FBEGTIME":"2024-09-14",
            "FENDTIME":"2024-09-14",
            "FMEMO": "休息时间不能离开",
            "FCHECKUSE": "",
            "FCHECKDATE": "",
            "FNOTE":"",
            "FBILLTYPE":"访客卡",
            "FBILLSTATE": "已布防",
            "FPOINT":"上海博物馆"
            },{
            "FBILLNO": "K241130005", 
            "FBILLCREDATE":"2024-11-29",
            "FUSER": "4-401展位",
            "FTELNO": "四楼",
            "FUSEDATE": "2024-12-01",
            "FBEGTIME":"2024-09-14",
            "FENDTIME":"2024-09-14",
            "FMEMO": "休息时间不能离开",
            "FCHECKUSE": "",
            "FCHECKDATE": "",
            "FNOTE":"",
            "FBILLTYPE":"访客卡",
            "FBILLSTATE": "已布防",
            "FPOINT":"上海博物馆"
            },
        ],
        loading: false,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fuser: "",
          fcustomno: ""
        },
      };
    },
    computed: {},
    created() {
    },
    methods: {
      insert(row) {
        this.$refs.Form.init(row);
      },
    },
  };
</script>